<h1>Listing articles in section <%= @current_section.name %></h1>


<table>
  <tr>
  <% for column in Article.content_columns 
        unless column.name == "body" || column.name == "blurb" %>

  
    <th><%= column.human_name unless column.name == "body" || column.name == "blurb" %></th>
    <%end%>


  <% end %>
      <th>Article source title</th>
  </tr>
  
<% for article in @current_section.articles %>
  <tr>
  <% for column in Article.content_columns 
        unless column.name == "body" || column.name == "blurb"  %>
  
    <td><%=h article.send(column.name)  %></td>
    <%end%>
  <% end %>

    <td><%= link_to 'Show', :action => 'show_article', :id => article %></td>
    <td><%= link_to 'Edit', :action => 'edit_article', :id => article %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy_article', :id => article }, :confirm => 'Are you sure?' %></td>
  </tr>
<% end %>
</table>

 
